Release 10.1A: OpenEdge Deployment:
Managing 4GL Applications
Logical database names
A logical database name is a database reference that represents the name of a connected physical database. OpenEdge uses the logical database name to resolve database references. When a procedure is compiled against a database, OpenEdge stores the logical database name in the procedure’s r-code. When a procedure executes, its database references must match the logical name of a connected database.
A database has a logical name whenever it is connected. When you connect to a database, OpenEdge automatically assigns a default logical name for the current session. The default logical name consists of the physical database name without the
.dbsuffix. For example, if you connect to a database with the physical namemydb1.db, the default logical database name ismydb1. Alternatively, you can use the Logical Database Name (-ld) startup parameter to specify a logical database name other than the default.For example, to assign the logical name
firstdbto the physical databasemydb1.dbusing the PRO command, enter the command using the following syntax:
Logical database names allow you to run procedures on different physical databases without recompiling. To run a compiled procedure on a second physical database, the database must meet the following criteria:
- It must have the identical structure (data definitions) and table time stamps as the database you compiled the procedure against. However, if you use CRC-based object code (the default), the database’s table time stamps do not affect the ability of the code to run on the database. The structure of the database must be the same. For more information about CRC-based object code, see Appendix B "R-code Features and Functions."
- It must be connected with the same logical name as the database you compiled the procedure against.
A database connection fails if the logical database name of the database that you are connecting has the same logical name as an already connected database. If you try to connect a database with a logical database name that matches the logical database name of an existing connected database of the same database type (OpenEdge RDBMS, ORACLE, etc.), OpenEdge assumes that database is connected and ignores the request.
You can change a database’s logical name in a Progress 4GL procedure with the
CREATE ALIASstatement. For more information about logical and physical database names and aliases, and theCREATE ALIASstatement, see OpenEdge Development: Progress 4GL Reference and OpenEdge Development: Programming Interfaces .
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |